package com.zcup.designer.behavior.iterator;

public class Client {
    public static void main(String[] args) {
        ConcreteAggregate aggregate = new ConcreteAggregate();
        aggregate.set(0, "a");
        aggregate.set(1, "b");
        aggregate.set(2, "c");
        aggregate.set(3, "d");
        Iterator iterator = new ConcreteIterator(aggregate);
        System.out.println(iterator.first());
        System.out.println("========================");
        while (!iterator.isDone()) {
            System.out.println(iterator.currentItem());
            iterator.next();
        }
        System.out.println("========================");

    }
}
